<?php
/**
 * 
 * @param string $path
 * @return string 
 */
function basePath($path= '')
{
    return __DIR__ . '/' .$path;
}


/**
 * 
 * @param string $path
 * @return void
 */

function loadPartial($name)
{
    $partialPath = basePath("views/partials/{$name}.php");
    if(file_exists($partialPath)){
        require $partialPath;
    }
    else{
        echo "{$name}视图不存在! ";
    }
}






/**
 * 
 * @param string $path
 * @return void
 */

function loadView($name)
{
   $viewPath = basePath("views/{$name}.view.php");
 


    if(file_exists($viewPath)){
        require $viewPath;
    }
    else{
        echo "{$path}视图不存在! ";
    }
}



/**
 * 
 * @param mixed $value
 * @return void
 */

function inspect($value){
    echo '<pre>';
    var_dump($value);
    echo '<pre>';
}




/**
 * 
 * @param mixed $name
 * @return void
 */
    function inspectAnDie($value){
        echo '<pre>';
        die(var_dump($value));
        echo '<pre>';
    }

?>